using UnityEngine;

public class RandomBlood : MonoBehaviour
{
	public SpriteRenderer sr;

	public Sprite[] sprites;

	public Gradient colors;

	private Color color;

	private float colorA;

	private float colorAUdapteValue = -0.001f;

	private void Awake()
	{
		sr.sprite = sprites[Random.Range(0, sprites.Length)];
		color = colors.Evaluate(Random.Range(0f, 1f));
		colorA = color.a;
		sr.color = color;
		Object.Destroy(this);
	}

	private void FixedUpdate()
	{
	}

	public void FadeOut()
	{
		colorA += colorAUdapteValue;
		sr.color = new Color(color.r, color.g, color.b, colorA);
		if (colorA <= 0.01f)
		{
			Object.Destroy(base.gameObject);
		}
	}
}
